import axios from 'axios'
import qs from "qs";

export async function getPurchaseList(){
    var resp = await axios.get('/api/purchase/show');
    return resp.data;
}

export async function queryPurchaseList(queryCondition){
    var resp = await axios.get('/api/purchase/query', {
        params: {
            commodityName:queryCondition.commodityName,
            commodityType:queryCondition.commodityType,
        }
    });
    return resp.data;
}

export async function updatePurchase(purchasingPlanSeq,status){
    var resp = await axios.get('/api/purchase/update', {
        params: {
            purchasingPlanSeq: purchasingPlanSeq,
            status: status,
        }
    });
    return resp.data;
}

//测试
export async function testSend(testPurchasingPlan){
    var resp = await axios.get('/api/purchase/test', {
        params: {
            testPurchasingPlanSeq: testPurchasingPlan.testPurchasingPlanSeq,
            testCommodityCode: testPurchasingPlan.testCommodityCode,
            testPurchasingPlanNum: testPurchasingPlan.testPurchasingPlanNum,
            testPurchasingPlanDeadline: testPurchasingPlan.testPurchasingPlanDeadline,
        }
    });
    return resp.data;
}
